import 'package:flutter/material.dart';

class AboutPage extends StatefulWidget {
  const AboutPage({Key? key}) : super(key: key);

  @override
  State<AboutPage> createState() => _AboutPageState();
}

class _AboutPageState extends State<AboutPage> {

  List<String> titles = ['家乡介绍', '家乡优势', '关于我们'];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('关于我们'),
        centerTitle: true,
        elevation: 0,
      ),
      body: Container(
        child: ListView.builder(
          shrinkWrap: true,
          itemCount: titles.length,
          itemBuilder: (BuildContext context, int index) {
            return aboutItem(titles[index]);
          }
        ),
      ),
    );
  }

  Widget aboutItem(String content) {
    return Container(
        height: 50,
        margin: EdgeInsets.only(left: 15),
        decoration: BoxDecoration(
            border: Border(
                bottom: BorderSide(color: Colors.grey.withOpacity(0.2))
            )
        ),
        child: Row(
          children: [
            Icon(Icons.message),
            SizedBox(width: 15),
            Text(content)
          ],
        )
    );
  }
}
